package com.job.admin.audit.controller;

import com.job.admin.audit.service.AuditAvatarService;
import com.job.admin.audit.service.AuditPostsService;
import com.job.admin.model.audit.dto.AuditAvatarPageDto;
import com.job.admin.model.audit.dto.AuditPostsPageDto;
import com.job.client.common.result.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/admin/audit/posts")
@Api(tags = "审核职位接口文档")
public class AuditPostsController {
    @Autowired
    private AuditPostsService auditPostsService;
    @PostMapping("/list/{page}/{size}")
    @ApiOperation("获得职位审核分页数据")
    public ResponseResult getList(
            @PathVariable Integer page,
            @PathVariable Integer size,
            @RequestBody AuditPostsPageDto dto
    ){
        return auditPostsService.getList(page,size,dto);
    }
    @GetMapping("/userInfo")
    @ApiOperation("获得职位审核用户信息")
    public ResponseResult getUserInfo(@RequestParam String userId){
        return auditPostsService.getUserInfo(userId);
    }
    @GetMapping("/auditSuccess")
    @ApiOperation("职位审核成功")
    public ResponseResult auditSuccess(@RequestParam String auditPostsId,@RequestParam String userNumber){
        return auditPostsService.auditSuccess(auditPostsId,userNumber);
    }
    @GetMapping("/{auditPostsId}")
    @ApiOperation("通过id获得职位审核结果数据")
    public ResponseResult getPostsResultById(@PathVariable String auditPostsId){
        return auditPostsService.getPostsResultById(auditPostsId);
    }
    @GetMapping("/auditError")
    @ApiOperation("职位审核失败")
    public ResponseResult auditError(
            @RequestParam String auditPostsId,
            @RequestParam String userNumber,
            @RequestParam String errorMessage){
        return auditPostsService.auditError(auditPostsId,userNumber,errorMessage);
    }
    @PostMapping("/info")
    public ResponseResult getPostsInfo(@RequestBody String postsId){
        return auditPostsService.getPostsInfo(postsId);
    }
    @GetMapping("/getAuditInfo")
    @ApiOperation("获得该用户未审核的数据")
    public ResponseResult getAuditInfo(@RequestParam String userId){
        return auditPostsService.getAuditInfo(userId);
    }
}
